<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
        .box1{
            width: 150px;
            height: 150px;
            /* 创建一个BFC */
            overflow: hidden;
            background-color: pink;
            margin-top: 20px;
        }

        .box2{
            height: 100px;
            width: 100px;
            /* box2盒子的margin失效？ */
            margin-top: 20px;
            background-color: skyblue;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2"></div>
    </div>
    
</body>
</html>